package com.billing.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.billing.aop.Auditable;
import com.billing.persistance.dao.IGenericDAO;
import com.billing.persistance.entities.BillingEntryConcept;

@Service
public class BillingEntryConceptService implements IBillingEntryConceptService {

	@Autowired
	@Qualifier(value="billingEntryConceptDAO")
	private IGenericDAO<BillingEntryConcept, Long> conceptDAO;
	
	@Auditable
	@Transactional
	public void createEntryConcept(BillingEntryConcept concept) {
		conceptDAO.create(concept);
	}

	@Auditable
	@Transactional
	public void deleteEntryCopcept(BillingEntryConcept concept) {
		conceptDAO.delete(concept);
	}

	@Auditable
	@Transactional
	public void updateEntryConcept(BillingEntryConcept concept) {
		conceptDAO.update(concept);
	}

	@Transactional(readOnly = true)
	public List<BillingEntryConcept> getAllEntryConcepts() {
		return conceptDAO.getList("");
	}
   
  @Transactional(readOnly = true)
	public BillingEntryConcept getEntryConcept(Long id) {
		return conceptDAO.read(id);
	}

}
